#include "Door.h"
#include "Listtexture.h"
#include "Define.h"

Door::Door(void){}
Door::~Door(void){}
Door::Door (int left, int top, int _id)
{
	sprite = new Sprite(Listtexture::DOOR,Listtexture::DOOR_WIDTH,Listtexture::DOOR_HEIGHT,
		Listtexture::DOOR_COUNT,Listtexture::DOOR_SPRITEPERROW);
	id = _id;
	type = _DOOR;
	width = Listtexture::DOOR_WIDTH;
	height = Listtexture::DOOR_HEIGHT;
	UpdateRect(left,top,width,height);
	animateRate = Listtexture::DOOR_ANIMATE;
	lastAnimate = GetTickCount();
}
void Door::update()
{
	DWORD now = GetTickCount();
	if(now - lastAnimate > animateRate)
	{
		sprite->Next();
		lastAnimate = now;
	}
}